package util

import "encoding/json"

func InSlice3(items []int, item int) bool {
	for _, eachItem := range items {
		if eachItem == item {
			return true
		}
	}
	return false
}

func StructToJsonStr(o interface{}) string {
	if o == nil {
		return ""
	}
	if str, ok := o.(string); ok {
		return str
	}
	bytes, _ := json.Marshal(o)
	return string(bytes)
}
